package ddd;
import ddd.constant.MonsterEnum;
import ddd.constant.PlayerEnum;
import ddd.constant.WeaponEnum;

/**
 * 网站：
 * @author dengzhiyuan
 * @version 1.0
 * @time 2021/5/24 18:16
 */
public class DddMainTest {

    public static void main(String[] args) {

        new DddMainTest().testDragoonSpecial();
    }


    public void testDragoonSpecial() {
        // Given
        Player dragoon = PlayerFactory.createPlayer(PlayerEnum.Dragoon, "Dart");
        Weapon sword = WeaponFactory.createWeaponFromPrototype(  WeaponEnum.Sword,"Soul Eater");
        EquipmentService equipmentService = new EquipmentServiceImpl();
        dragoon.equip(sword, equipmentService);
        Monster dragon = MonsterFactory.createMonster(MonsterEnum.Dragon, 100);

        CombatService combatService = new CombatServiceImpl();
        // When
        combatService.performAttack(dragoon, dragon);

        // Then
        System.out.println(dragon.getHealth());
        System.out.println(dragon.isAlive());
    }

}
